<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增睡眠记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-record-add">
<!--            <div class="col-xs-12">-->
<!--                <div class="form-group">-->
<!--                    <label class="col-sm-3 control-label is-required">用户ID3：</label>-->
<!--                    <div class="col-sm-8">-->
<!--                        <input name="userId" class="form-control" type="text" required>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">填报日期：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="recordDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">上床时间：</label>
                    <div class="col-sm-8">
                        <input name="bedTime" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">起床时间：</label>
                    <div class="col-sm-8">
                        <input name="wakeTime" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">入睡耗时：</label>
                    <div class="col-sm-8">
                        <input name="sleepLatency" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">夜间醒来次数：</label>
                    <div class="col-sm-8">
                        <input name="nightWakings" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">实际睡眠时长：</label>
                    <div class="col-sm-8">
                        <input name="sleepDuration" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">是否有补偿行为</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('forced_sleep')}">
                            <input type="radio" th:id="${'compensationBehavior_' + dict.dictCode}" name="compensationBehavior" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'compensationBehavior_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">是否有努力入睡行为：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('forced_sleep')}">
                            <input type="radio" th:id="${'forcedSleep_' + dict.dictCode}" name="forcedSleep" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'forcedSleep_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">是否执念8小时睡眠：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('forced_sleep')}">
                            <input type="radio" th:id="${'eightHoursPursuit_' + dict.dictCode}" name="eightHoursPursuit" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'eightHoursPursuit_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">是否缺乏运动：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('forced_sleep')}">
                            <input type="radio" th:id="${'lackOfExercise_' + dict.dictCode}" name="lackOfExercise" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'lackOfExercise_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">是否过度关注症状：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('forced_sleep')}">
                            <input type="radio" th:id="${'symptomFocus_' + dict.dictCode}" name="symptomFocus" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'symptomFocus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">心情状态：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('bus_mood_state')}">
                            <input type="radio" th:id="${'moodState_' + dict.dictCode}" name="moodState" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'moodState_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/record"
        $("#form-record-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-record-add').serialize());
            }
        }

        $("input[name='recordDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>
